<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="人员管理" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData()"
                            ng-disabled="!btnPermission.userAdd" title="{{!btnPermission.userAdd?'无权限执行此操作':''}}">新增</button>
                    <button class="btn btn-operate" ng-click="delData('batch')"
                            ng-disabled="!btnPermission.userDel" title="{{!btnPermission.userDel?'无权限执行此操作':''}}">删除</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="用户名" ng-model="condition.name">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">用户名：</label>
                        <input type="text" name="name" class="form-control col-xs-8" ng-model="condition.name">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">手机号：</label>
                        <input type="text" name="mobile" class="form-control" ng-model="condition.mobile">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">状态：</label>
                        <select class="form-control" ng-model="condition.locked" ng-options="item.id as item.name for item in userStatues">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll()"></div>
                                </th>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.scrollLeft"></div>
                                </th>
                                <th width="200" class="border-r-none">
                                    操作
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item)"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'"
                                    title="{{item[itemCol.dataField]}}">
                                    {{item[itemCol.dataField]}}
                                </td>
                                <td width="200" class="font-0">
                                    <button class="btn btn-operate m-r-xs" ng-click="restPwd(item)"
                                            ng-disabled="!btnPermission.userResetPwd" title="{{!btnPermission.userResetPwd?'无权限执行此操作':''}}">重置密码</button>
                                    <button class="btn btn-operate m-r-xs" ng-click="switchLockStatues(item.userId, 'lock')"
                                            ng-disabled="item.locked === 1 || !btnPermission.userLocked" title="{{!btnPermission.userLocked?'无权限执行此操作':''}}">锁定</button>
                                    <button class="btn btn-operate m-r-xs" ng-click="switchLockStatues(item.userId, 'enabled')"
                                            ng-disabled="item.locked === 0 || !btnPermission.userLocked" title="{{!btnPermission.userLocked?'无权限执行此操作':''}}">启用</button>
                                    <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                            ng-disabled="!btnPermission.userEdit" title="{{!btnPermission.userEdit?'无权限执行此操作':''}}">编辑</button>
                                    <button class="btn btn-operate" ng-click="delData('single', item.userId)"
                                            ng-disabled="!btnPermission.userDel" title="{{!btnPermission.userDel?'无权限执行此操作':''}}">删除</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    {{item[itemCol.dataField]}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allChecked" yb-check-name="全选" yb-click="selectAll()"></div>
                <button class="btn btn-operate" ng-click="delData('batch')"
                        ng-disabled="!btnPermission.userDel" title="{{!btnPermission.userDel?'无权限执行此操作':''}}">删除</button>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i>用户账号：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="loginName" class="form-control" ng-model="detailInfo.loginName"
                                   required yb-focus ng-disabled="tabFlag.type === 1" maxlength="20">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.loginName.$dirty || (form.loginName.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.loginName.$error.required && !form.loginName.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i>用户名：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="realName" class="form-control" ng-model="detailInfo.name" required
                                   yb-focus maxlength="20">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.realName.$dirty || (form.realName.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.realName.$error.required && !form.realName.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 control-label">昵称：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="nickName" class="form-control" ng-model="detailInfo.nickname" maxlength="20">
                        </div>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 control-label">性别：</label>
                        <label class="col-xs-5 control-label p-l-n text-left">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.sex" value="1"
                                   yb-radio-name="男">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.sex" value="0"
                                   yb-radio-name="女">
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i>所属部门：</label>
                        <div class="col-xs-5 wrapper-none" department-selector ng-model="dataSelected.department"></div>
                        <div class="col-xs-4 msg-block" ng-show="submitted && !dataSelected.department.id">
                            <div class="error-msg">
                                <i class="yb-icon ico-times-circular"></i>请选择部门
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 control-label"><i>*</i>用户角色：</label>
                        <div role-selector class="col-xs-5 wrapper-none dropdown-prop" ng-model="dataSelected.role"></div>
                        <div class="col-xs-4 msg-block" ng-show="submitted && !dataSelected.role.name">
                            <div class="error-msg">
                                <i class="yb-icon ico-times-circular"></i>请选择角色
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-none">
                        <label class="col-xs-2 control-label"></label>
                        <label class="col-xs-5 wrapper-none text-left disable-color">角色可多选</label>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label">联系电话：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="telephone" class="form-control" ng-model="detailInfo.telephone"
                                   yb-tel yb-focus maxlength="20">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.telephone.$dirty || (form.telephone.$invalid&&submitted)">
                            <div class="error-msg" ng-show="form.telephone.$error.tel && !form.telephone.focused">
                                <i class="yb-icon ico-times-circular"></i>电话号码格式错误
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label">手机号：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="mobile" class="form-control" ng-model="detailInfo.mobile"
                                   yb-mobile yb-focus maxlength="11">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.mobile.$dirty || (form.mobile.$invalid&&submitted)">
                            <div class="error-msg" ng-show="form.mobile.$error.mobile && !form.mobile.focused">
                                <i class="yb-icon ico-times-circular"></i>手机号格式错误
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-sm">
                        <label class="col-xs-2 control-label">电子邮箱：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="email" class="form-control" ng-model="detailInfo.email" yb-email
                                   yb-focus maxlength="50">
                        </div>
                        <div class="col-xs-4 msg-block" ng-show="form.email.$dirty || (form.email.$invalid && submitted)">
                            <div class="error-msg" ng-show="form.email.$error.email && !form.email.focused">
                                <i class="yb-icon ico-times-circular"></i>邮箱格式错误
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b">
                        <label class="col-xs-2 control-label">是否锁定：</label>
                        <label class="col-xs-5 control-label p-l-n text-left">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.locked" value="1"
                                   yb-radio-name="是">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.locked" value="0"
                                   yb-radio-name="否">
                        </label>
                    </div>
                    <div class="form-group m-t-n-sm m-b-sm" ng-if="tabFlag.type === 0">
                        <label class="col-xs-2 control-label"></label>
                        <label class="col-xs-5 wrapper-none text-left danger-color">
                            注：新建用户初始密码为：SgcX!515
                        </label>
                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)">保存</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
            </div>
        </div>
    </div>
</div>